<%@ page pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='ggymzy'/></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">

        </div>

    </div>

    <div class="layui-card">
        <div class="layui-field-box layui-form">

            <table class="layui-table" lay-size="sm">
                <thead>
                <tr>
                    <th width="5%"><fmt:message key='xh'/></th>
                    <th><fmt:message key='ymmc'/></th>
                    <th><fmt:message key='cz'/></th>
                </tr>
                </thead>
                <c:forEach var="item" items="${list}" varStatus="status">
                       <tr>
                           <td>${status.index + 1}</td>
                           <td>${item.name}</td>
                           <td>
                               <input type="button" value="<fmt:message key='fzurl'/>" class="layui-btn layui-btn-sm copy-url" data-url="${item.url}">
                           </td>
                       </tr>
                </c:forEach>
            </table>
        </div>
    </div>

</div>

<script>

    layui.use("layer", function () {

        $(".copy-url").click(function () {
            var url = $(this).attr("data-url");
            var transfer = $("<input type='text' id='copy_text'>");
            $("body").append(transfer);
            transfer.val(url)
            transfer.focus();
            transfer.select();
            document.execCommand('Copy', false, null);
            $('#copy_text').remove();
            layer.msg("<fmt:message key='fzcg'/>");
        });
    });
</script>
</body>
</fmt:bundle>
</html>
